import 'package:flutter/material.dart';
import 'package:flutter_app/values/MyColors.dart';
import 'package:get/get.dart';

import '../../r.dart';
import 'welcome_logic.dart';

/**
 * @Description: 欢迎页面
 * @Author: 下雨了
 * @CreateDate: 2022年6月20日 14:44:21
 * @Version: 1.0
 */
///
class WelcomePage extends StatefulWidget {
  final String title;

  WelcomePage({Key? key, required this.title}) : super(key: key);

  @override
  _WelcomePageState createState() => _WelcomePageState();
}

class _WelcomePageState extends State<WelcomePage> {
  final logic = Get.put(WelcomeLogic());
  final state = Get.find<WelcomeLogic>().state;

  @override
  Widget build(BuildContext context) {
    return GetBuilder<WelcomeLogic>(builder: (logic) {
      return Scaffold(
        backgroundColor: MyColors.FFF5F5F5,
        body: Stack(
          children: [
            Align(
              alignment: Alignment.topCenter,
              child: Image.asset(
                R.assetsImgWelcomeBg,
                fit: BoxFit.fitWidth,
                width: MediaQuery.of(context).size.width,
              ),
            ),
            Align(
              alignment: Alignment.topCenter,
              child: Container(
                margin: EdgeInsets.only(top: 90),
                height: 90,
                child: Image.asset(
                  R.assetsImgWelcomeTop,
                  fit: BoxFit.fitHeight,
                  width: MediaQuery.of(context).size.width,
                ),
              ),
            ),
            Align(
              alignment: Alignment.bottomCenter,
              child: Container(
                margin: EdgeInsets.only(bottom: 60),
                height: 35,
                child: Image.asset(
                  R.assetsImgWelcomeBottom,
                  fit: BoxFit.fitHeight,
                  width: MediaQuery.of(context).size.width,
                ),
              ),
            ),
          ],
        ),
      );
    });
  }

  @override
  void dispose() {
    Get.delete<WelcomeLogic>();
    super.dispose();
  }
}
